#include<iostream>

using namespace std;

class Solution {
public:
    bool isPalindrome(string s) {
        string str;
        for (char ch : s)
        {
            if ((ch >= 'a' && ch <= 'z')||(ch>='0'&&ch<='9'))
            {
                str += ch;
            }
            else if (ch >= 'A' && ch <= 'Z')
            {
                str += (ch + 32);
            }

        }

        if (str.size() == 1 || str.size() == 0)return true;
        else
        {
            int begin = 0;
            int end = str.size() - 1;
            while (begin <= end)
            {
                if (str[begin] != str[end])return false;
                else
                {
                    begin++;
                    end--;
                }

            }
            return true;
        }
    }
};